//
//  UIAlertView+debugAlertView.m
//  TravelGuideMdd
//
//  Created by 陈曦 on 14/11/10.
//  Copyright (c) 2014年 mafengwo.com. All rights reserved.
//

#import "UIAlertView+debugAlertView.h"
#import "UIAlertView+Blocks.h"

@implementation UIAlertView (debugAlertView)

- (id)initWithDebugTitle:(NSString *)title message:(NSString *)message
{
#ifdef DEBUG
    RIButtonItem *cancelItem = [RIButtonItem itemWithLabel:@"取消"];
    RIButtonItem *copyItem = [RIButtonItem itemWithLabel:@"复制"];
    
    copyItem.action = ^{
        [UIPasteboard generalPasteboard].string = [NSString stringWithFormat:@"%@\n\n%@",title,message];
    };
    
    
    self = [self initWithTitle:title
                       message:message
              cancelButtonItem:cancelItem
              otherButtonItems:copyItem,nil];
    return self;
#else
    return nil;
#endif
}

@end
